package com.sg.dto.integration.component;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @desc NodeAttributeGraphDatabaseDto
 * @使用场景
 */
@Data
public class NodeAttributeGraphDatabaseDto
        extends BaseDto
        implements Serializable {

    /**
     * 属性名称
     */
    @NotNull(message = "属性名称不能为空")
    @ApiModelProperty("属性名称")
    private String attributeName;

    /**
     * 属性类型 WORD:WORD文档 EXCEL:EXCEL文档 PDF:PDF文档
     */
    @NotNull(message = "属性类型不能为空")
    @ApiModelProperty("属性类型")
    private String attributeType;

    /**
     * 属性值
     */
    @NotNull(message = "属性值不能为空")
    @ApiModelProperty("属性值")
    private String attributeValue;

    /**
     * 节点ID（唯一标识）
     */
    @ApiModelProperty("节点ID（唯一标识）")
    private String nodeId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        NodeAttributeGraphDatabaseDto that = (NodeAttributeGraphDatabaseDto) o;
        return (
                attributeName == that.attributeName &&
                        attributeType == that.attributeType &&
                        attributeValue == that.attributeValue &&
                        nodeId == that.nodeId
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                attributeName,
                attributeType,
                attributeValue,
                nodeId
        );
    }

}
